#ifndef MAILBOX_H_
#define MAILBOX_H_

#include "../messages/Message.h"
#include <pthread.h>
#include <queue>

using namespace std;

class Mailbox
{
private:
	int capacity;
	queue<Message*> inbox;
	pthread_mutex_t	m_quantaLock;
	pthread_cond_t	m_quantaCond;

public:
	Mailbox();
	Mailbox(int capa);
	virtual ~Mailbox();
	bool submitMessage(Message* msg);
	bool hasNewMessage();
	Message* popMessage();
	void clearMailbox();

};

#endif /*MAILBOX_H_*/
